package com.examination.system.instructor;


import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
/**
 * @author 寇淇芮
 * @Date 2019/8/18 12:08
 */
@SpringBootApplication
@EnableTransactionManagement
@MapperScan("com.examination.system.instructor.dao")
@EntityScan("com.examination.system.instructor.*.**")//扫描实体类
@ComponentScan(basePackages={"com.examination.api"})//扫描接口
@ComponentScan(basePackages={"com.examination.system.instructor"})//扫描本项目下的所有类
@ComponentScan(basePackages = {"com.examination.framework"})//扫描错误接口
public class MainInstructorApplication {
    public static void main(String[] args) {
        SpringApplication.run(MainInstructorApplication.class,args);
    }
    
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate(new OkHttp3ClientHttpRequestFactory());
    }

}
